/**
 * @author xiaobyu
 * @created Jun 16, 2016
 * 
 */
package mdt.figure;

import org.tigris.gef.presentation.FigText;
import mdt.model.IMDTModel;

public class FigNamed extends FigSingleLineText{

	private static final long serialVersionUID = 1L;
	private final String nameText;

  /**
   * @param name the text to show
   */
  public FigNamed(IMDTModel owner, String name) {
      super(owner);
      initialize();
      nameText = name;
      setText(name);
      setOwner(owner);
  }
  
  private void initialize() {
      //setTextFilled(false);
      setJustification(FigText.JUSTIFY_CENTER);
      setRightMargin(3);
      setLeftMargin(3);
      setFilled(true);
      super.setLineWidth(0);
  }
  
  /* Force the line-width to 0, since the FigGroup that contains the 
   * stereotype may want to show a border, but we don't. */
  @Override
  public void setLineWidth(int w) {
      super.setLineWidth(w);
  }

  /**
   * This is needed for updating the guillemet style.
   */
  @Override
  protected void setText() {
      setText(nameText);
  }


  public void setText(String text) {
      super.setText(text);
  }

	
}
